home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / ip / trace / tcpdump / tcpdump-2.2-2.2.1.diff < prev    next >
Encoding:
Text File  |  1992-06-01  |  10.0 KB  |  403 lines

  1. *** /tmp/,RCSt1a08672    Tue Jun  2 19:07:00 1992
  2. --- interface.h    Tue Jun  2 17:57:28 1992
  3. ***************
  4. *** 18,24 ****
  5.    * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  6.    * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  7.    *
  8. !  * @(#) $Header: interface.h,v 1.45 91/11/03 16:35:21 mccanne Exp $ (LBL)
  9.    */
  10.   
  11.   #ifdef __GNUC__
  12. --- 18,24 ----
  13.    * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  14.    * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  15.    *
  16. !  * @(#) $Header: interface.h,v 1.46 92/06/02 17:57:22 mccanne Exp $ (LBL)
  17.    */
  18.   
  19.   #ifdef __GNUC__
  20. ***************
  21. *** 35,41 ****
  22.   extern char *calloc();
  23.   #endif
  24.   
  25. - extern int cflag;        /* only print 'cnt' packets */
  26.   extern int dflag;        /* print filter code */
  27.   extern int eflag;        /* print ethernet header */
  28.   extern int nflag;        /* leave addresses as numbers */
  29. --- 35,40 ----
  30. *** /tmp/,RCSt1a08672    Tue Jun  2 19:07:01 1992
  31. --- pcap-bpf.c    Tue Jun  2 17:57:32 1992
  32. ***************
  33. *** 20,26 ****
  34.    */
  35.   #ifndef lint
  36.   static  char rcsid[] =
  37. !     "@(#)$Header: pcap-bpf.c,v 1.28 92/05/25 15:40:37 mccanne Exp $ (LBL)";
  38.   #endif
  39.   
  40.   #include <stdio.h>
  41. --- 20,26 ----
  42.    */
  43.   #ifndef lint
  44.   static  char rcsid[] =
  45. !     "@(#)$Header: pcap-bpf.c,v 1.29 92/06/02 17:57:29 mccanne Exp $ (LBL)";
  46.   #endif
  47.   
  48.   #include <stdio.h>
  49. ***************
  50. *** 107,117 ****
  51.           ep = bp + cc;
  52.           while (bp < ep) {
  53.               register int caplen, hdrlen;
  54.               (*printit)(bp + (hdrlen = bhp->bh_hdrlen),
  55.                      &bhp->bh_tstamp, bhp->bh_datalen,
  56.                      caplen = bhp->bh_caplen);
  57. -             if (cflag && --cnt == 0)
  58. -                 goto out;
  59.               bp += BPF_WORDALIGN(caplen + hdrlen);
  60.           }
  61.   #undef bhp
  62. --- 107,117 ----
  63.           ep = bp + cc;
  64.           while (bp < ep) {
  65.               register int caplen, hdrlen;
  66. +             if (cnt >= 0 && --cnt < 0)
  67. +                 goto out;
  68.               (*printit)(bp + (hdrlen = bhp->bh_hdrlen),
  69.                      &bhp->bh_tstamp, bhp->bh_datalen,
  70.                      caplen = bhp->bh_caplen);
  71.               bp += BPF_WORDALIGN(caplen + hdrlen);
  72.           }
  73.   #undef bhp
  74. *** /tmp/,RCSt1a08672    Tue Jun  2 19:07:02 1992
  75. --- pcap-enet.c    Tue Jun  2 17:57:34 1992
  76. ***************
  77. *** 75,85 ****
  78.   .th_wirelen ;
  79.               if (bpf_filter(fcode, (char *)ph->packet,
  80.                           ph->tap.th_wirelen, caplen)) {
  81.                   (*printit)((char *)ph->packet,
  82.                       (struct timeval *)ph->tap.th_timestamp,
  83.                       ph->tap.th_wirelen, caplen);
  84. -                 if (cflag && --cnt == 0)
  85. -                     goto out;
  86.               }
  87.               inc = ph->length.PacketOffset;
  88.               cc -= inc;
  89. --- 75,85 ----
  90.   .th_wirelen ;
  91.               if (bpf_filter(fcode, (char *)ph->packet,
  92.                           ph->tap.th_wirelen, caplen)) {
  93. +                 if (cnt >= 0 && --cnt < 0)
  94. +                     goto out;
  95.                   (*printit)((char *)ph->packet,
  96.                       (struct timeval *)ph->tap.th_timestamp,
  97.                       ph->tap.th_wirelen, caplen);
  98.               }
  99.               inc = ph->length.PacketOffset;
  100.               cc -= inc;
  101. ***************
  102. *** 88,96 ****
  103.   #else    /* !IBMRTPC */
  104.           caplen = cc > snaplen ? snaplen : cc ;
  105.           if (bpf_filter(fcode, buf.hdr.packet, cc, caplen)) {
  106. !             (*printit)(buf.hdr.packet, &tv, cc, caplen);
  107. !             if (cflag && --cnt == 0)
  108.                   goto out;
  109.           }
  110.   #endif    /* IBMRTPC */
  111.       }
  112. --- 88,96 ----
  113.   #else    /* !IBMRTPC */
  114.           caplen = cc > snaplen ? snaplen : cc ;
  115.           if (bpf_filter(fcode, buf.hdr.packet, cc, caplen)) {
  116. !             if (cnt >= 0 && --cnt < 0)
  117.                   goto out;
  118. +             (*printit)(buf.hdr.packet, &tv, cc, caplen);
  119.           }
  120.   #endif    /* IBMRTPC */
  121.       }
  122. *** /tmp/,RCSt1a08672    Tue Jun  2 19:07:04 1992
  123. --- pcap-nit.c    Tue Jun  2 17:57:36 1992
  124. ***************
  125. *** 20,26 ****
  126.    */
  127.   #ifndef lint
  128.   static  char rcsid[] =
  129. !     "@(#)$Header: pcap-nit.c,v 1.13 91/11/02 14:35:27 leres Exp $ (LBL)";
  130.   #endif
  131.   
  132.   #include <stdio.h>
  133. --- 20,26 ----
  134.    */
  135.   #ifndef lint
  136.   static  char rcsid[] =
  137. !     "@(#)$Header: pcap-nit.c,v 1.14 92/06/02 17:57:34 mccanne Exp $ (LBL)";
  138.   #endif
  139.   
  140.   #include <stdio.h>
  141. ***************
  142. *** 70,79 ****
  143.   {
  144.       u_char buf[CHUNKSIZE];
  145.       struct bpf_insn *fcode;
  146. !     int cc, i;
  147.   
  148.       fcode = fp->bf_insns;
  149. -     i = 0;
  150.   
  151.       while ((cc = read(if_fd, (char *)buf, sizeof(buf))) > 0) {
  152.           register u_char *bp, *bstop;
  153. --- 70,78 ----
  154.   {
  155.       u_char buf[CHUNKSIZE];
  156.       struct bpf_insn *fcode;
  157. !     int cc;
  158.   
  159.       fcode = fp->bf_insns;
  160.   
  161.       while ((cc = read(if_fd, (char *)buf, sizeof(buf))) > 0) {
  162.           register u_char *bp, *bstop;
  163. ***************
  164. *** 115,126 ****
  165.               if (caplen > snaplen)
  166.                   caplen = snaplen;
  167.               if (bpf_filter(fcode, sp, nh->nh_wirelen, caplen)) {
  168. !                 (*printit)(sp, &nh->nh_timestamp, 
  169. !                        nh->nh_wirelen, caplen);
  170. !                 if (cflag && ++i >= cnt) {
  171.                       wrapup(if_fd);
  172.                       return;
  173.                   }
  174.               }
  175.           }
  176.       }
  177. --- 114,125 ----
  178.               if (caplen > snaplen)
  179.                   caplen = snaplen;
  180.               if (bpf_filter(fcode, sp, nh->nh_wirelen, caplen)) {
  181. !                 if (cnt >= 0 && --cnt < 0) {
  182.                       wrapup(if_fd);
  183.                       return;
  184.                   }
  185. +                 (*printit)(sp, &nh->nh_timestamp, 
  186. +                        nh->nh_wirelen, caplen);
  187.               }
  188.           }
  189.       }
  190. *** /tmp/,RCSt1a08625    Tue Jun  2 19:05:41 1992
  191. --- pcap-pf.c    Tue Jun  2 18:57:02 1992
  192. ***************
  193. *** 20,26 ****
  194.    */
  195.   #ifndef lint
  196.   static  char rcsid[] =
  197. !     "@(#)$Header: pcap-pf.c,v 1.17 91/11/02 14:35:29 leres Exp $ (LBL)";
  198.   #endif
  199.   
  200.   /*
  201. --- 20,26 ----
  202.    */
  203.   #ifndef lint
  204.   static  char rcsid[] =
  205. !     "@(#)$Header: pcap-pf.c,v 1.19 92/06/02 18:56:55 mccanne Exp $ (LBL)";
  206.   #endif
  207.   
  208.   /*
  209. ***************
  210. *** 90,96 ****
  211.          bytes large. */
  212.       struct enstamp buf[BUFSPACE / sizeof(struct enstamp)];
  213.   
  214.       fcode = fp->bf_insns;
  215.       while (1) {
  216.           register u_char *bp;
  217. --- 90,95 ----
  218. ***************
  219. *** 113,124 ****
  220.                   break;
  221.               }
  222.   
  223. -             TotPkts++;
  224. -             TotDrops += stamp.ens_dropped;
  225. -             TotMissed = stamp.ens_ifoverflows;
  226. -             if (OrigMissed < 0)
  227. -                 OrigMissed = TotMissed;
  228.               p = bp + stamp.ens_stamplen;
  229.   
  230.               buflen = stamp.ens_count;
  231. --- 112,117 ----
  232. ***************
  233. *** 126,136 ****
  234.                   buflen = snaplen;
  235.   
  236.               if (bpf_filter(fcode, p, stamp.ens_count, buflen)) { 
  237.                   (*printit)(p, &stamp.ens_tstamp,
  238.                          stamp.ens_count, buflen);
  239. -                 if (cflag && --cnt == 0)
  240. -                     goto out;
  241.               }
  242.               inc = ENALIGN(buflen + stamp.ens_stamplen);
  243.               cc -= inc;
  244.               bp += inc;
  245. --- 119,135 ----
  246.                   buflen = snaplen;
  247.   
  248.               if (bpf_filter(fcode, p, stamp.ens_count, buflen)) { 
  249. +                 if (cnt >= 0 && --cnt < 0)
  250. +                     goto out;
  251.                   (*printit)(p, &stamp.ens_tstamp,
  252.                          stamp.ens_count, buflen);
  253.               }
  254. +             TotPkts++;
  255. +             TotDrops += stamp.ens_dropped;
  256. +             TotMissed = stamp.ens_ifoverflows;
  257. +             if (OrigMissed < 0)
  258. +                 OrigMissed = TotMissed;
  259.               inc = ENALIGN(buflen + stamp.ens_stamplen);
  260.               cc -= inc;
  261.               bp += inc;
  262. *** /tmp/,RCSt1a08672    Tue Jun  2 19:07:06 1992
  263. --- pcap-snit.c    Tue Jun  2 17:57:41 1992
  264. ***************
  265. *** 20,26 ****
  266.    */
  267.   #ifndef lint
  268.   static  char rcsid[] =
  269. !     "@(#)$Header: pcap-snit.c,v 1.14 91/11/02 14:35:25 leres Exp $ (LBL)";
  270.   #endif
  271.   
  272.   /*
  273. --- 20,26 ----
  274.    */
  275.   #ifndef lint
  276.   static  char rcsid[] =
  277. !     "@(#)$Header: pcap-snit.c,v 1.15 92/06/02 17:57:39 mccanne Exp $ (LBL)";
  278.   #endif
  279.   
  280.   /*
  281. ***************
  282. *** 99,111 ****
  283.       void (*printit)();
  284.   {
  285.       u_char buf[CHUNKSIZE];
  286. !     int cc, i;
  287.       int drops;
  288.       struct nit_stat *nsp = &nstat;
  289.       register struct bpf_insn *fcode = fp->bf_insns;
  290.   
  291. -     i = 0;
  292.       while ((cc = read(if_fd, (char*)buf, sizeof buf)) >= 0) {
  293.           register u_char *bp, *cp, *bufstop;
  294.           struct nit_bufhdr *hdrp;
  295. --- 99,109 ----
  296.       void (*printit)();
  297.   {
  298.       u_char buf[CHUNKSIZE];
  299. !     int cc;
  300.       int drops;
  301.       struct nit_stat *nsp = &nstat;
  302.       register struct bpf_insn *fcode = fp->bf_insns;
  303.   
  304.       while ((cc = read(if_fd, (char*)buf, sizeof buf)) >= 0) {
  305.           register u_char *bp, *cp, *bufstop;
  306.           struct nit_bufhdr *hdrp;
  307. ***************
  308. *** 146,157 ****
  309.                   caplen = snaplen;
  310.   
  311.               if (bpf_filter(fcode, cp, nlp->nh_pktlen, caplen)) {
  312. !                 (*printit)(cp, &ntp->nh_timestamp,
  313. !                        nlp->nh_pktlen, caplen);
  314. !                 if (cflag && ++i >= cnt) {
  315.                       wrapup(if_fd);
  316.                       return;
  317.                   }
  318.               }
  319.           }
  320.       }
  321. --- 144,155 ----
  322.                   caplen = snaplen;
  323.   
  324.               if (bpf_filter(fcode, cp, nlp->nh_pktlen, caplen)) {
  325. !                 if (cnt >= 0 && --cnt < 0) {
  326.                       wrapup(if_fd);
  327.                       return;
  328.                   }
  329. +                 (*printit)(cp, &ntp->nh_timestamp,
  330. +                        nlp->nh_pktlen, caplen);
  331.               }
  332.           }
  333.       }
  334. *** /tmp/,RCSt1a08672    Tue Jun  2 19:07:08 1992
  335. --- tcpdump.c    Tue Jun  2 17:57:44 1992
  336. ***************
  337. *** 22,28 ****
  338.   char copyright[] =
  339.       "@(#) Copyright (c) 1987-1990 The Regents of the University of California.\nAll rights reserved.\n";
  340.   static  char rcsid[] =
  341. !     "@(#)$Header: tcpdump.c,v 1.67 92/02/17 15:20:35 mccanne Exp $ (LBL)";
  342.   #endif
  343.   
  344.   /*
  345. --- 22,28 ----
  346.   char copyright[] =
  347.       "@(#) Copyright (c) 1987-1990 The Regents of the University of California.\nAll rights reserved.\n";
  348.   static  char rcsid[] =
  349. !     "@(#)$Header: tcpdump.c,v 1.68 92/06/02 17:57:41 mccanne Exp $ (LBL)";
  350.   #endif
  351.   
  352.   /*
  353. ***************
  354. *** 51,57 ****
  355.   int Nflag;            /* remove domains from printed host names */
  356.   int pflag;            /* don't go promiscuous */
  357.   int qflag;            /* quick (shorter) output */
  358. - int cflag;            /* XXX mystery global flag pcap routines want */
  359.   int tflag = 1;            /* print packet arrival time */
  360.   int eflag;            /* print ethernet header */
  361.   int vflag;            /* verbose */
  362. --- 51,56 ----
  363. *** /tmp/,RCSt1a08672    Tue Jun  2 19:07:10 1992
  364. --- tcpslice.c    Tue Jun  2 17:57:48 1992
  365. ***************
  366. *** 22,28 ****
  367.   char copyright[] =
  368.       "@(#) Copyright (c) 1987-1990 The Regents of the University of California.\nAll rights reserved.\n";
  369.   static  char rcsid[] =
  370. !     "@(#)$Header: tcpslice.c,v 1.9 92/02/17 12:08:15 vern Exp $ (LBL)";
  371.   #endif
  372.   
  373.   /*
  374. --- 22,28 ----
  375.   char copyright[] =
  376.       "@(#) Copyright (c) 1987-1990 The Regents of the University of California.\nAll rights reserved.\n";
  377.   static  char rcsid[] =
  378. !     "@(#)$Header: tcpslice.c,v 1.10 92/06/02 17:57:44 mccanne Exp $ (LBL)";
  379.   #endif
  380.   
  381.   /*
  382. ***************
  383. *** 42,48 ****
  384.   #include "version.h"
  385.   
  386.   
  387. - int cflag = 0;    /* global that savefile routines are sensitive to */
  388.   int tflag = 0;    /* global that util routines are sensitive to */
  389.   
  390.   char *program_name;
  391. --- 42,47 ----
  392. *** /tmp/,RCSt1a08672    Tue Jun  2 19:07:12 1992
  393. --- VERSION    Tue Jun  2 18:06:19 1992
  394. ***************
  395. *** 1 ****
  396. ! 2.2
  397. --- 1 ----
  398. ! 2.2.1
  399.